#!/usr/bin/env python
# $Id: fwdb.py 83306ac00e39 2013/03/03 02:04:53 pgurumur $
# Copyright (c) 2013 Prabhu Gurumurthy <pgurumur@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# File fwdb.py generated on Sunday February 17, 2013 @20:41:44 PST
#
__version__  = "$Revision: 83306ac00e39 $"
__author__   = "$Author: pgurumur $"
__modified__ = "$Date: 2013-03-03 02:04:53Z $"

from venya.lib import ip, sql, stdlib

from sqlalchemy import Column, Integer, String, Numeric, Unicode
from sqlalchemy.ext.declarative import declartive_base

Base = declartive_base()
class Address(Base):
   __tablename__ = u'address'

   pk = Column(Integer, primary_key = True)
   ipaddress = Column(Numeric(40, 0), nullable = False)
   version = Column(Integer, nullable = False)
   prefix = Column(Integer, nullable = False)
   description = Column(Numeric(75), nullable = True)
   lastupdate = Column(Numeric(11, 7), nullable = False)

class Firewall(Base):
   __tablename__ = u'firewall'

   pk = Column(Integer, primary_key = True)
   name = Column(Unicode(75), nullable = False)
   ipaddress = Column(Integer, ForeignKey("address.pk"), nullable = False)
   description = Column(Unicode(75), nullable = True)
   lastupdate = Column(Numeric(11, 7),  nullable = False)

class FirewallZone(Base):
   __tablename__ = u'firewall_zone'

   pk = Column(Integer, primary_key = True)
   zone = Column(Unicode(75), nulltable = False)
   firewall = Column(Integer, ForeignKey("firewall.pk"), nullable = False)
   description = Column(Unicode(75), nullable = True)
   lastupdate = Column(Numeric(11, 7),  nullable = False)

class AddressBook(Base):
   __tablename__ = u'address_book'

   pk = Column(Integer, primary_key = True)
   zone = Column(Integer, ForeignKey("firewall_zone.pk"), nullable = False)
   name = Column(Unicode(75), nullable = False)
   ipaddress = Column(Integer, ForeignKey("address.pk"), nullable = False)
   description = Column(Unicode(75), nullable = True)
   lastupdate = Column(Numeric(11, 7),  nullable = False)

class ZoneServices(Base)
   __tablename__ = u'zone_services'

   pk = Column(Integer, primary_key = True)
   service = Column(

